-module(threads).
-export([start/0,wait/0,send/1]).

wait() ->
	receive
		{word, X} ->
			io:format("Got ~s~n", [X]),
			wait();
		stop ->
			io:format("End~n")
	end.

send(Pid) ->
	Pid ! {word, "Hello"},
	Pid ! {word, "World"},
	Pid ! stop.

start() ->
	Pid = spawn(threads, wait, []),
	spawn(threads, send, [Pid]).
	